#include <iostream>
#include <stdio.h>

using namespace std;

class List {
	public:
		int x;
		List *next;

	List * Insert (int value, List * lp) {
		List * next;
		next = new List; next->next = lp; next->x = value; return next;
	}

	List * List::Add (int value, List * lp) {
		List * next;
		next = new List; next->next = lp; next->x = value; return next;
	}

	void DumpList(List * lp) {
		if ( NULL != lp) {
			cout << lp->x <<"\n";
			DumpList (lp->next); 
		}
		else
		{
			cout << "NULL" << endl;
		}

	}

	List * List::Find (const int &value) {
		if ( value == this->x ) 
			return this;
		if ( next != NULL) 
			return next->Find(value);
		else 
			return NULL; 
	}
};

int main2()
{
	List* lp = new List;
	for (int i=0; i != 42; i++)
		lp = lp->Add(i,lp);

	lp->DumpList(lp);
	return 0; 
}
